import { matchAll } from '@/router'

export const getConfRoutes = () => {
  const files = require.context('./', true, /\.js$/)
  let modules = []
  files.keys().forEach(file => {
    if (!file.startsWith('./index')) { // 排除当前文件
      const current = files(file).default
      if (file.startsWith('./Dashboard')) {
        modules = [...current, ...modules,]
      } else {
        modules = [...modules, ...current]
      }
    } 
  })
  modules.push(matchAll)
  return modules
}
